package cn.edu.zzuli.nothinglink.entity;

import cn.edu.zzuli.nothinglink.vo.CourseTeacherVo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Course implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 课程id
     */
    @TableId(value = "course_id", type = IdType.AUTO)
    private Integer courseId;

    /**
     * 老师的id
     */
    private Integer courseTeaId;

    /**
     * 课程名
     */
    private String courseName;

    /**
     * 课程人数
     */
    private Integer courseNumber;

    private String courseUrl;

    private String courseImgUrl;

    private String courseDesc;

//    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    private LocalDateTime endTime;

    /**
     * 乐观锁版本号version字段，为了防止并发修改课程人数出错
     */
    private Integer version;

    @TableLogic
    private Integer deleted;

    /**
     * 用于学生端，数据回显，懒得创建vo了
     */
    @TableField(exist = false)
    private CourseTeacherVo teacherInfo;


}
